<table width="100%" cellspacing="0">
  <tbody>
    <tr>
      <?php if($this->auth) {?>
      <td valign="top" bgcolor="#f0f0f0" style="width:170px"><table width = "100%" cellpadding="0" cellspacing="0" bgcolor="#f0f0f0">
          <tr>
            <td><table border="0" cellpadding="3" cellspacing="0" width="100%" style="border-bottom:1px solid blue">
                <tbody>
                  <tr>
                    <td bgcolor="#dddddd"><span style="float: left;"><b>Project </b></span></td>
                  </tr>
                </tbody>
              </table></td>
          </tr>
          <tr>
            <td><table border="0" cellpadding="3" cellspacing="0" width="100%">
                <tbody>
                  <tr>
                    <td valign="top"><a href="<?=$this->baseUrl()?>/project">Projects</a></td>
                  </tr>
                </tbody>
              </table></td>
          </tr>
        </table>
        <table width = "100%" cellpadding="0" cellspacing="0" bgcolor="#f0f0f0">
          <tr>
            <td><table border="0" cellpadding="3" cellspacing="0" width="100%" style="border-bottom:1px solid blue">
                <tbody>
                  <tr>
                    <td bgcolor="#dddddd"><span style="float: left;"><b>User, Groups &amp; Roles </b></span></td>
                  </tr>
                </tbody>
              </table></td>
          </tr>
          <tr>
            <td><table border="0" cellpadding="3" cellspacing="0" width="100%">
                <tbody>
                  <tr>
                    <td valign="top"><a href="<?=$this->baseUrl()?>/user/browse">User Browser </a></td>
                  </tr>
                  <tr>
                    <td valign="top"><a href="<?=$this->baseUrl()?>/groups/browse">Group Browser</a></td>
                  </tr>
                  <tr>
                    <td valign="top"><a href="<?=$this->baseUrl()?>/roles/browse">Project Role Browser </a></td>
                  </tr>
                </tbody>
              </table></td>
          </tr>
        </table>
        <table width = "100%" cellpadding="0" cellspacing="0" bgcolor="#f0f0f0">
          <tr>
            <td><table border="0" cellpadding="3" cellspacing="0" width="100%" style="border-bottom:1px solid blue">
                <tbody>
                  <tr>
                    <td bgcolor="#dddddd"><span style="float: left;"><b>Issue Settings </b></span></td>
                  </tr>
                </tbody>
              </table></td>
          </tr>
          <tr>
            <td><table border="0" cellpadding="3" cellspacing="0" width="100%">
                <tbody>
                  <tr>
                    <td valign="top"><a href="<?=$this->baseUrl()?>/type/manage">Issue types</a></td>
                  </tr>
                  <tr>
                    <td valign="top"><a href="<?=$this->baseUrl()?>/priority/manage">Priorities</a></td>
                  </tr>
                  <tr>
                    <td valign="top"><a href="<?=$this->baseUrl()?>/resolution/manage">Resolutions</a></td>
                  </tr>
                  <tr>
                    <td><a href="<?=$this->baseUrl()?>/status/manage">Statuses</a></td>
                  </tr>
                </tbody>
              </table></td>
          </tr>
        </table></td>
      <?php }?>
      <td valign="top">
        <br>
        <table width="98%" cellspacing="0" style="border:1px solid #3C78B5" align="center">
          <tr bgcolor="#3C78B5">
            <td bgcolor="#F0F0F0" style="border-bottom:0px"><h3>Edit User Groups</h3></td>
          </tr>
          <tr>
            <td bgcolor="#F0F0F0">This page lets you edit group memberships for a user. </td>
          </tr>
		  <tr>
		  	<td height="4">&nbsp;</td>
		  </tr>
          <tr>
            <td bgcolor="#ffffff" valign="top">
				<table width="100%" cellpadding="0" cellspacing="0">
					<tr>
						<td width="50%" align="center" valign="top">
							<form id="joinGroupForm" name="joinGroupForm" action="" method="post"

>							<table width="100%" cellpadding="0" cellspacing="0">
								<tr bgcolor="#fffff0">
									<td align="center" height="25"><strong>Available Groups</strong></td>	
								</tr>
								<tr>
									<td align="center"><input type="submit" value="Join >>" name="join" id="join" /></td>
								</tr>
								<tr>
									<td align="center">
										<select name="groupsToJoin[]" multiple id="groupsToJoin" size="<?=count($this->availableGroups)?>">
						    				<?php foreach ($this->availableGroups as $availableGroup) {?>
												<option value="<?=$availableGroup['groupname']?>"><?=$availableGroup['groupname']?></option>
											<?php }?>
										</select>
										<input type="hidden" id="id" value = "<?=$this->id?>" name = "id" />
									</td>
								</tr>
							</table>
							</form>						</td>
						<td width="50%" align="center" valign="top">
							<form id="leaveGroupForm" name="leaveGroupForm" action="" method="post"
>
							<table width="100%" cellpadding="0" cellspacing="0">
								<tr bgcolor="#fffff0">
									<td align="center" height="25"><strong>Groups</strong></td>	
								</tr>
								<tr>
									<td align="center"><input type="submit" value="<< Leave" name="leave" id="leave" /></td>
								</tr>
								<tr>
									<td align="center">
										<select name="groupsToLeave[]" multiple="multiple" id="groupsToLeave" size="<?=count($this->userGroups)?>">
						    				<?php foreach ($this->userGroups as $userGroup) {?>
												<option value="<?=$userGroup['group_name']?>"><?=$userGroup['group_name']?></option>
											<?php }?>
										</select>
										<input type="hidden" id="id" value = "<?=$this->id?>" name = "id" />
										</td>
								</tr>
							</table>
							</form>						</td>
					</tr>
				</table>			</td>
          </tr>
      </table></td>
    </tr>
  </tbody>
</table>
